#include <standard.hlsli>
#include <WR2Parameters.hlsli>

struct VS_OUTPUT
{
	float4 Position : SV_POSITION0;
	float2 Texcoord : TEXCOORD1;
	float3 Normal   : TEXCOORD0;
};

float4 ps_main(VS_OUTPUT Input) : SV_TARGET
{
	float4 white = float4(1, 0, 1, 0.0f);
	float4 Tex = xColoredTexture1_Tex.Sample(Tex1, Input.Texcoord.xy);

	///*if (withoutTexture == true)
	//{
	//	Tex = white;
	//}*/
	//
	if (Tex.a < 0.5f)
		discard;
	//
	float3 Nn = normalize(Input.Normal);                 // Normal;
		float Diff = dot(Nn, -lightDir);
	//
	Tex.xyz = float3((Tex.rgb) * (AmbientColor.xyz + Diff + SunColor));

	//Tex.xyz = (Tex.rgb * color.rgb);

	//Tex = white;

	return Tex;
}